<template>
	<view class="content1">
		<view class="all" @click="submit(item)" v-for="(item,index) in list">
			<view class="all1">
				<image :src="item.images.split(',')[0]" class="logo" />
				<view class="all_1">
					<view class="all_1_1 huanhang">{{item.title}}</view>
					<view class="all_1_02" v-if="!my&&!cgx&&!sc&&bq&&item.sign&&item.sign.length>0">
						<text v-for="(a,b) in item.sign">{{a}}</text>
					</view>
					<view class="all_1_2 huanhang">
						{{item.detail_address}}
					</view>
					<view class="all_1_3">
						<view class="all_1_3_1">
							<text class="tc">租金：</text>
							<view class="all_1_3_2">{{item.rent}}/
								<text style="font-size: 23rpx">月</text>
							</view>
						</view>
						<view class="all_1_3_1">
							<text class="tc">转让费：</text>
							<view class="all_1_3_2">{{item.transfer_fee}}/
								<text style="font-size: 23rpx">万</text>
							</view>
						</view>
					</view>
					<view class="all2">
						<view class="all2_1">发布时间：{{item.createtime|timeFormat('yyyy-mm-dd')}}</view>
						<view class="all2_2" v-if="!cg">
							<image :style="{
							'margin-left': index?'-10rpx':''
						}" v-for="(item,index) in 3"
								src="http://puputong.huijipin.cn/uploads/20220321/37753aa5d99af0ec66edf30779441f19.png" />
							<text>{{item.view_num}}人查看</text>
						</view>
					</view>
					<!-- 我的发布 -->
					<image class="cgal" v-if="cg"
						src="http://puputong.huijipin.cn/uploads/20220321/1dc687406fb479cc4533b0460fcdbdd4.png" />
					<view class="botton" v-if="my">
						<text @click="fb1(1)" :style="{
							background:!index?'#7D7D7D':'',
							opacity:!index? '0.5':'',
							border: !index?'':'1px solid #FF1B1B',
							color:!index?'#FFFFFF':' #FF1B1B'
						}">置顶</text>
						<text @click="fb1(2)" :style="{
							background:!index?'#FF1B1B':'',
							opacity:!index? '0.9':'',
							border: !index?'':'1px solid #FF1B1B',
							color:!index?'#FFFFFF':' #FF1B1B'
						}">下架</text>
					</view>
					<!-- 草稿箱 -->
					<view class="botton" v-if="cgx">
						<text @click="cgx1(1)" :style="{
							background:!index?'#7D7D7D':'',
							opacity:!index? '0.5':'',
							border: !index?'':'1px solid #FF1B1B',
							color:!index?'#FFFFFF':' #FF1B1B'
						}">删除</text>
						<text @click="cgx1(2)" :style="{
							background:!index?'#FF1B1B':'',
							opacity:!index? '0.9':'',
							border: !index?'':'1px solid #FF1B1B',
							color:!index?'#FFFFFF':' #FF1B1B'
						}">发布</text>
					</view>
				</view>

			</view>
			<view class="xian" v-if="index!=list.length-1">

			</view>
		</view>
	</view>

</template>

<script>
	export default {
		// cg成功转让
		//my我的发布
		//cgx我的草稿箱
		//sc我的收藏
		//bq控制标签显示
		props: {
			list: {
				type: Array,
				default: () => []
			},
			sc: {
				type: Boolean,
				default: false
			},
			cg: {
				type: Boolean,
				default: false
			},
			my: {
				type: Boolean,
				default: false
			},
			bq: {
				type: Boolean,
				default: true
			},
			cgx: {
				type: Boolean,
				default: false
			}
		},
		name: "info-carp",
		data() {
			return {

			};
		},
		methods: {
			//详情跳转
			submit(item) {
				uni.navigateTo({
					url: `/pages/shoppingMall/infoDetail?info_id=${item.info_id}`
				})
			},
			fb1(a) {
				this.$emit('fb', a)
			},
			// 草稿箱
			cgx1(a) {
				this.$emit('cgx', a)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.botton {
		margin-top: 40rpx;
		text-align: right;

		text:nth-of-type(1) {
			display: inline-block;
			width: 158rpx;
			height: 60rpx;
			background: #FFFFFF;
			border-radius: 30rpx;
			text-align: center;
			line-height: 60rpx;
			font-size: 26rpx;
			font-family: OPPOSans;
			font-weight: 500;
		}

		text {
			display: inline-block;
			width: 158rpx;
			height: 60rpx;
			background: #FFFFFF;
			border-radius: 30rpx;
			text-align: center;
			line-height: 60rpx;
			font-size: 26rpx;
			font-family: OPPOSans;
			font-weight: 500;
		}

		text:nth-of-type(2) {
			margin-left: 20rpx;
			display: inline-block;
			width: 158rpx;
			height: 60rpx;
			// background: #FFFFFF;
			// border: 1px solid #FF1B1B;
			border-radius: 30rpx;
			text-align: center;
			line-height: 60rpx;
			font-size: 26rpx;
			font-family: OPPOSans;
			font-weight: 500;
			// color: #FF1B1B;
		}
	}

	.cgal {
		width: 89rpx !important;
		height: 77rpx !important;
		position: absolute;
		right: 20rpx;
		top: 59%;
	}

	.all {
		padding: 30rpx 30rpx 0rpx 30rpx;
		background-color: #FFFFFF;
		box-sizing: border-box;

		.all1 {
			display: flex;
			justify-content: space-between;
			position: relative;
			padding-bottom: 35rpx;
		}

		.xian {
			height: 1px;
			background: #F1F1F1;
		}

		.all2_2 {
			display: flex;
			align-items: center;

			text {
				font-size: 20rpx;
				font-family: OPPOSans;
				font-weight: 400;
				color: #999999;

			}
		}

		.all2 {
			margin-top: 25rpx;
			display: flex;
			justify-content: space-between;

			.all2_1 {
				font-size: 20rpx;
				font-family: OPPOSans;
				font-weight: 400;
				color: #999999;
			}

			image {
				width: 30rpx;
				height: 30rpx;
				border-radius: 100%;
			}
		}

		.all_1 {
			width: 67%;

			.all_1_02 {
				margin-top: 10rpx;
				display: flex;

				text {
					padding: 3rpx 10rpx 3rpx 10rpx;
					margin-right: 20rpx;
				}

				text:nth-of-type(1) {
					display: inline-block;
					height: 27rpx;
					border: 1rpx solid rgba($color: #FF1B1B, $alpha:0.2);
					border-radius: 4rpx;
					font-size: 19rpx;
					text-align: center;
					line-height: 27rpx;
					font-family: OPPOSans;
					font-weight: 500;
					color: #FF0404;
				}

				text:nth-of-type(2) {
					display: inline-block;
					height: 27rpx;
					border: 1rpx solid rgba($color: #FF911B, $alpha:0.2);
					border-radius: 4rpx;
					font-size: 19rpx;
					text-align: center;
					line-height: 27rpx;
					font-family: OPPOSans;
					font-weight: 500;
					color: #FF911B;
				}

				text {
					display: inline-block;
					height: 27rpx;
					border: 1rpx solid rgba($color: #FF1B1B, $alpha:0.2);
					border-radius: 4rpx;
					font-size: 19rpx;
					text-align: center;
					line-height: 27rpx;
					font-family: OPPOSans;
					font-weight: 500;
					color: #FF0404;
				}

				text:nth-of-type(3) {
					display: inline-block;
					height: 27rpx;
					border: 1rpx solid rgba($color: #FF1B1B, $alpha:0.2);
					border-radius: 4rpx;
					font-size: 19rpx;
					text-align: center;
					line-height: 27rpx;
					font-family: OPPOSans;
					font-weight: 500;
					color: #FF0404;
				}
			}

			.all_1_1 {
				font-size: 30rpx;
				font-family: OPPOSans;
				font-weight: bold;
				color: #181818;
			}

			.all_1_2 {
				font-size: 24rpx;
				font-family: OPPOSans;
				margin: 10rpx 0 10rpx 0;
				font-weight: 500;
				color: #666666;
			}

			.all_1_3 {
				width: 408rpx;
				height: 105rpx;
				padding-left: 20rpx;
				box-sizing: border-box;
				background: #F4F5F7;
				border-radius: 10rpx;
				display: flex;
				align-items: center;
				// border: 1px solid black;
				justify-content: space-between;

				.all_1_3_2 {
					margin-top: 10rpx;
					display: flex;
					align-items: center;
					font-size: 30rpx;
					font-family: OPPOSans;
					font-weight: bold;
					color: #FF1B1B;

					text:nth-of-type(1) {
						display: flex;
						font-size: 23rpx;
						font-family: OPPOSans;
						font-weight: bold;
						color: #FF1B1B;
					}
				}

				.all_1_3_1 {
					width: 50%;

					.tc {
						display: block;
						font-size: 22rpx;
						font-family: OPPOSans;
						font-weight: 500;
						color: #999999;
					}
				}
			}
		}

		.logo {
			width: 200rpx;
			border-radius: 8rpx;
			height: 200rpx;
		}
	}
</style>
